// koa-generator生成自带请求日志中间件
module.exports = {
  name: "req_logger",

  async core(ctx, next) {
    const start = new Date();
    await next();
    const ms = new Date() - start;
    console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
  },
};
